/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package frc.circuitrunners;

import edu.wpi.first.wpilibj.*;
import frc.circuitrunners.IO;
import frc.circuitrunners.RobotSubsystem;
/**
 *
 * @author CircuitRunners
 */
public class BridgeDepressor extends RobotSubsystem {
    /**
     * Victor used to control the motor powering the Bridge Depressor
     */
    private Victor BDVictor;
    
    public void depress(double speed){
        BDVictor.set(-speed);
    }
    /**
     * What the bridge depressor does during autonmous
     * Stage 1:
     * Stage 2:
     * Stage 3:
     */
    public void autonomous() {
        switch(stage){
            
        }
    }
    
    /**
     * Initializes the Bridge Depressor Subsystem
     */
    public void init() {
        BDVictor = new Victor(1);
    }

    /**
     * How the Bridge Depressor behaves during normal teleop operation
     * Drive Joystick Button 3 Pressed - Lower Bridge Depressor at 100% max force
     * Drive Joystick Button 5 Pressed - Raise Bridge Depressor at 45% max force
     * No Button Pressed - Stop All Bridge Depressor Movement
     */
    public void teleop() {
        if(IO.getJoystickButton(IO.JOY_DRIVE, 3)){
            BDVictor.set(-1.0);
        }else if(IO.getJoystickButton(IO.JOY_DRIVE, 5)) {
            BDVictor.set(0.45);
        } else {
            BDVictor.set(0.0);
        }
    }

    /**
     * How the Bridge Depressor Behaves when the robot is disabled
     * Stops the Bridge Depressor's movements completely
     */
    public void disable() {
        BDVictor.set(0.0);
    }
    
    /**
     * How the Bridge Depressor behaves when the robot is auto-aiming
     * Stops the Bridge Depressor's movements completely
     */
    public void autoAim() {
        disable();
    }

    /**
     * How the Bridge Depressor behaves when the robot is auto-balancing
     * Drive Joystick Button 3 Pressed - Lower Bridge Depressor at 100% max force
     * Drive Joystick Button 5 Pressed - Raise Bridge Depressor at 45% max force
     * No Button Pressed - Stop All Bridge Depressor Movement
     */
    public void autoBalance() {
        teleop();
    }
    
}
